package hibernate.billStream;

import java.util.Date;
import java.util.StringTokenizer;
import hibernate.p.Address;
import hibernate.p.TelNumber;
import hibernate.p.Pair;
import hibernate.p.Unit;
import hibernate.administratorAccount.Employee;

public class CorpInfo {
	
	private String abbrName=new String();
	private String fullName=new String();
	private Address address=new Address(null,null,null,null);
	private boolean isCurrentBillSource=false;
	private Pair depositeRemainder=new Pair(new Double(0),Unit.getChinese());
	private Pair upperBoundBillPrice=new Pair(new Double(0),Unit.getChinese());
	private String contact=new String();
	private Employee registerer;
	private String note=new String();
	private TelNumber telNumber1=new TelNumber(-1,-1,-1,-1);
	private TelNumber telNumber2=new TelNumber(-1,-1,-1,-1);
	private TelNumber telNumber3=new TelNumber(-1,-1,-1,-1);
	private TelNumber telNumber4=new TelNumber(-1,-1,-1,-1);
	private Long id=new Long(-1);
	private CorporationEntity corporationEntity;
	private Date time;
	
	public Date getRegisterTime(){
		return time;
	}
	
	public void setRegisterTime(Date time){
		this.time=time;
	}
	
	public CorporationEntity getCorporationEntity(){return corporationEntity;}
	
	public void setCorporationEntity(CorporationEntity corp)
	{this.corporationEntity=corp;}
	
	public void setId(Long id){this.id=id;}
	
	public Long getId(){return id;}
	
	public void setAbbrName(String abbrName){
		this.abbrName=abbrName;
	}
	
	public String getAbbrName(){
		return abbrName;
	}
	
	public void setFullName(String fullname){
		fullName=fullname;
	}
	
	public String getFullName(){
		return fullName;
	}
	
	public void setAddress(String address){
		this.address =Address.parseAddress(address);
	}
	
	public String getAddress(){
		return address.toString();
	}
	
	public void setIsCurrentBillSource(boolean isCurrentBillSource){
		this.isCurrentBillSource=isCurrentBillSource;
	}
	
	public boolean getIsCurrentBillSource(){
		return isCurrentBillSource;
	}
	
	public Double getDepositeRemainder(){
		return ((Double)depositeRemainder.getFirst()).doubleValue();
	}
	
	public void setDepositeRemainder(Double info){
		this.depositeRemainder.setFirst(info);
	}
	
	public Unit getDepositeRemainderUnit(){
		return ((Unit)this.depositeRemainder.getSecond());
	}
	
	public void setDepositeRemainderUnit(String unit){
		this.depositeRemainder.setSecond(Unit.parseUnit(unit));
	}
	
	public Double getUpperBoundBillPrice(){
		return ((Double)upperBoundBillPrice.getFirst()).doubleValue();
	}
	
	public void setUpperBoundBillPrice(Double info){
		this.upperBoundBillPrice.setFirst(info);
	}
	
	public Unit getUpperBoundBillPriceUnit(){
		return ((Unit)this.upperBoundBillPrice.getSecond());
	}
	
	public void setUpperBoundBillPriceUnit(String unit){
		this.upperBoundBillPrice.setSecond(Unit.parseUnit(unit));
	}
	
	public void setContact(String contact){
		this.contact=contact;
	}
	
	public String getContact(){
		return contact;
	}
	
	public void setRegisterer(Employee register){
		registerer=register;
	}
	
	public Employee getRegisterer(){
		return registerer;
	}
	
	public void setNote(String note){
		this.note=note;
	}
	
	public String getNote(){
		return note;
	}
	
	public void setTelNumber1(String number){
		telNumber1=TelNumber.parseString(number);
	}
	
	public String getTelNumber1(){
		return telNumber1.toString();
	}
	
	public void setTelNumber2(String number){
		telNumber2=TelNumber.parseString(number);
	}
	
	public String getTelNumber2(){
		return telNumber2.toString();
	}
	
	public void setTelNumber3(String number){
		telNumber3=TelNumber.parseString(number);
	}
	
	public String getTelNumber3(){
		return telNumber3.toString();
	}
	
	public void setTelNumber4(String number){
		telNumber4=TelNumber.parseString(number);
	}
	
	public String getTelNumber4(){
		return telNumber4.toString();
	}
	
	public boolean equals(Object obj){
		if(!(obj instanceof CorpInfo))
			return false;
		else return ((CorpInfo)obj).id.equals(id);
	}
}
